import request from '@/utils/request'

const baseUrl = '/oauth'

// 登录
export function login(data: LoginData) {
  return request({
    url: `${baseUrl}/login`,
    method: 'post',
    data: data
  });
}

// 获取当前用户的权限
export function getUserPermission(data: any) {
  return request({
    url: `${baseUrl}/permissions`,
    method: 'get',
    data: data
  });
}

// 重置密码登录
export function rePassword(data: ChangePasswordData) {
  return request({
    url: `${baseUrl}/reToken`,
    method: 'post',
    data: data
  });
}


// 退出接口
export function logout() {
  return request({
    url: `${baseUrl}/logout`,
    method: 'post'
  });
}